
var n = !1;
Page({
  data: {
    page: 1,
    like_count: {},
    review_count: {},
    fans_count: {},
    list: [{
      img: "/weitao/images/news_praise.png",
      name: "点赞",
      cont: "平时多点赞，朋友常相伴",
      time: "5分钟前",
      number: 1,
      url: "/pages/praise/praise"
    }]
  },

  onLoad: function (t) {
    var s = this;
    wx.setNavigationBarTitle({
      title: '消息'
    })
    getApp().page.onLoad(this, t);

    s.loadData()
  },
  loadData: function () {
    var t = this,
      _this = this,
      a = this.data.page;
    getApp().core.showLoading({}), getApp().request({
      url: getApp().api.weitao.get_message,
      data: {
        page: a,
      },
      method: "get",
      success: function (e) {
        getApp().core.hideLoading()
        if (0 == e.code) {
          var i = t.data.list,
            s = e.data.list,
            n = !1;
          10 == s.length && (n = !0), i = i.concat(s), a++, t.setData({
            list: s,
            page: a,
            more_list: n,
            review_count: e.data.review_count,
            like_count: e.data.like_count,
            fans_count: e.data.focus_count,
            user: e.data.user
          });
          console.log(t.data.list);
        } else getApp().core.showToast({
          title: e.msg,
          icon: 'none'
        });
      },
      fali: function (t) {
        getApp().core.hideLoading()
        getApp().core.showToast({
          title: t.msg,
          icon: 'none'
        });
      }
    });
  },
  //跳转页面
  goUrl: function (e) {
    var gopage = e.currentTarget.dataset.url,
      s = this;
    if (!gopage) {
      return;
    }
    console.log(gopage,"去");
    wx.navigateTo({
      url: gopage,
      events: {
        someEvent: function (data) {
          console.log('返回了');
          s.loadData();
        }
      },
      success: function (res) {}
    })
  },
  onReady: function () {

  },

  onShow: function () {

  },


  onHide: function () {

  },

  onunload(){ 
    const eventChannel = this.getOpenerEventChannel()
    eventChannel.emit('someEvent', 1);
  },

  onPullDownRefresh: function () {

  },

  onReachBottom: function () {

  },

  onShareAppMessage: function () {

  }
})